package com.will.maze;

import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.view.WindowManager;

public class Square extends MazeObject{
	
	private int sLength;
	
	public Square(Context context, int x, int y){
		super(context);
		this.x=x;
		this.y=y;
		sLength = 20;
	}
	
	public int getSLength(){
		return sLength;
	}
	
	@Override
	public void move(int newx, int newy, int z, MazeObject mo) {
		
		//Boundaries
		if(x>width-25){
			x=width-25;
			setXDirection(0);

		}
		if(x<5){
			x=5;
			setXDirection(0);

		}
		if(y>height-100 ){
			y=height-100;
			setYDirection(0);

		}
		if(y<12){
			y=12;
			setYDirection(0);
		}
		
		//constantly adding x and y of ball with x and y Direction
		this.x+=xDirection;
		this.y+=yDirection;
		
		
	}
}
